using System;
using System.ComponentModel.DataAnnotations;

namespace ERP.Domain.Warehouse.Allocation
{
	/// <summary>
	/// 调拨单明细
	/// </summary>
	public class TransferOrderLine
	{
		[Key]
		public int Id { get; set; }

		public int TransferId { get; set; }

		/// <summary>
		/// 行号（从1开始）
		/// </summary>
		public int LineNo { get; set; }

		public int ProductId { get; set; }
		[Required]
		[StringLength(128)]
		public string ProductName { get; set; }
		[Required]
		[StringLength(64)]
		public string ProductNo { get; set; }
		[StringLength(128)]
		public string Specification { get; set; }
		[StringLength(16)]
		public string Unit { get; set; }

		public int? FromLocationId { get; set; }
		public int? ToLocationId { get; set; }

		/// <summary>
		/// 申请调拨数量
		/// </summary>
		public decimal ReqQty { get; set; }

		/// <summary>
		/// 已出库数量
		/// </summary>
		public decimal OutQty { get; set; }

		/// <summary>
		/// 已入库数量
		/// </summary>
		public decimal InQty { get; set; }

		/// <summary>
		/// 单价（用于金额展示/核算）
		/// </summary>
		public decimal UnitPrice { get; set; }

		public DateTime CreatedAt { get; set; } = DateTime.Now;
		public DateTime UpdatedAt { get; set; } = DateTime.Now;
	}
}

